
import 'dart:async';
import 'package:dio/dio.dart';
import 'package:dustbin_sort/model/news_model_entity.dart';
import 'package:dustbin_sort/model/select_res_entity.dart';


const SELECT_URL = 'http://127.0.0.1:8888/test/select';

class SearchDao{
	static Future<SelectResEntity> fetch() async{
		Response response = await Dio().get(SELECT_URL);
		if(response.statusCode == 200){
			return SelectResEntity().fromJson(response.data);
		}else{
			throw Exception("fail to load data from api");
		}
	}
}